<?php
/**
 * Created by littleU.
 * User: littleU
 * Date: 2021-02-02
 * Time: 10:51
 */

namespace app\api\controller\v1\cms;


use app\api\controller\BaseController;
use app\api\service\AdminRole as AdminRoleService;

class AdminRole extends BaseController
{
    public function index()
    {
        $result = AdminRoleService::getRoleList();
        return $result;
    }

    public function setRole()
    {
        $data = input('post.');
        $result = (new AdminRoleService())->setRole($data);
        return $result;
    }

    /**
     * 根据角色id获取权限树应该有的角色树形列表
     */
    public function getRoleMenuById()
    {
        $id = input('param.id');
        $result = AdminRoleService::getRoleMenuById($id);
        return $result;
    }
}